home *** CD-ROM | disk | FTP | other *** search
- on isHypertextLink wordNumber
- global clickedTopic
- set wordStyle to the textStyle of word wordNumber of field clickedTopic
- if wordStyle = "bold" then
- return 1
- else
- return 0
- end if
- end
-
- on goHypterTextLink hypertextWords
- global clickedTopic
- updateRecentChoices()
- set hypertextPhrase to getHypertextPhrase(hypertextWords)
- set clickedTopic to hypertextPhrase
- showTopicText()
- end
-
- on checkIfClickedHypertextLink
- global clickedTopic
- set wordNumber to the mouseWord
- set clickedWord to word wordNumber of field clickedTopic
- if isHypertextLink(wordNumber) then
- set hypertextWords to getHypertextWords(wordNumber)
- hiliteHypertextwords(hypertextWords)
- goHypterTextLink(hypertextWords)
- end if
- end
-
- on getHypertextWords wordNumber
- global clickedTopic
- set hypertextWords to [wordNumber]
- sort(hypertextWords)
- repeat with i = wordNumber - 1 down to 1
- if isHypertextLink(i) and not endsWithPunctuation(word i of field clickedTopic) then
- add(hypertextWords, i)
- next repeat
- end if
- exit repeat
- end repeat
- if not endsWithPunctuation(word wordNumber of field clickedTopic) then
- repeat with i = wordNumber + 1 to the number of words in field clickedTopic
- if isHypertextLink(i) then
- add(hypertextWords, i)
- if endsWithPunctuation(word i of field clickedTopic) then
- exit repeat
- end if
- next repeat
- end if
- exit repeat
- end repeat
- end if
- return hypertextWords
- end
-
- on hiliteHypertextwords hypertextWords
- global clickedTopic, hilitBackground
- set numHypertextWords to count(hypertextWords)
- set firstWord to getAt(hypertextWords, 1)
- set lastWord to firstWord + numHypertextWords - 1
- set the foreColor of word firstWord to lastWord of field clickedTopic to hilitBackground
- waitTicksRoll(20)
- set the foreColor of word firstWord to lastWord of field clickedTopic to 255
- end
-
- on getHypertextPhrase hypertextWords
- global clickedTopic
- set numHypertextWords to count(hypertextWords)
- set firstWord to getAt(hypertextWords, 1)
- set lastWord to firstWord + numHypertextWords - 1
- set hypertextPhrase to word firstWord to lastWord of field clickedTopic
- if endsWithPunctuation(hypertextPhrase) then
- set hypertextPhrase to removePunctuation(hypertextPhrase)
- end if
- return hypertextPhrase
- end
-